<template>
  <div class="flex-box align-center" style="min-width: 86px">
    <BellMenu style="margin-right: 30px"></BellMenu>
    <el-dropdown>
      <span class="el-dropdown-link">
        <el-avatar style="background: #48b6fd">
          {{ userInfo.userName || "--" }}
        </el-avatar>
      </span>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item>
            <el-button
              style="width: 90px"
              @click="router.push('/account/center')"
              >个人中心</el-button
            >
          </el-dropdown-item>
          <el-dropdown-item>
            <el-button style="width: 90px" @click="logoutHandle"
              >logout</el-button
            >
          </el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </div>
</template>
<script setup lang="ts">
import BellMenu from "./BellMenu.vue";
import { useRouter } from "vue-router";
import { useHeader } from "@/hooks/layout/useHeader";
const router = useRouter();
const { logoutHandle, userInfo } = useHeader();
</script>
